package 田忌赛马;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static int N = 1010;
    static int[] a = new int[N];
    static int[] b = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            if (n == 0) {
                break;
            }
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            for (int i = 0; i < n; i++) {
                b[i] = in.nextInt();
            }
            Arrays.sort(a, 0, n);
            Arrays.sort(b, 0, n);
            int s1 = 0, s2 = 0;
            int f1 = n - 1, f2 = n - 1;
            int res = 0;
            while (s1 <= f1) {
                if (judge(s1, s2) > 0) {
                    res++;
                    s1++;
                    s2++;
                } else if (judge(s1, s2) < 0) {
                    res--;
                    s1++;
                    f2--;
                } else {
                    if (judge(f1, f2) > 0) {
                        res++;
                        f1--;
                        f2--;
                    } else {
                        res += judge(s1, f2);
                        f2--;
                        s1++;
                    }
                }
            }
            System.out.println(res * 200);
        }
    }

    private static int judge(int x, int y) {
        if (a[x] > b[y]) {
            return 1;
        } else if (a[x] == b[y]) {
            return 0;
        }
        return -1;
    }
}
